// 预警级别
const warningArr = [
    {
        value: 0,
        // DRAFT,  
        label: '蓝色'
    },
    {
        value: 1,
        // value: 'SUBMITTED',
        label: '黄色'
    },
    {
        // value: 'PAST',
        value: 2,
        label: '红色'
    }
]

// 拟采取措施 状态
/**
 * @description 
 */
const proposedMeasures = [
    {
        value: 0,
        label: '待提交'
    },
    {
        value: 1,
        label: '审核中'
    },
    {
        value: 2,
        label: '审核通过'
    },
    {
        value: 3,
        label: '审核不通过'
    }
]

// 验收记录 状态
/**
 * @description 验收记录的显示
 * 1）拟采取措施审批通过前，未进入验收记录流程，状态为“-” proposedMeasures ！== 3
 * 2）拟采取措施审批通过后，直接进入验收流程，验收记录初始状态为“待验收”，
 */
const acceptanceRecord = [
    {
        value: 0,
        label: '-'
    },
    {
        value: 1,
        label: '待验收'
    },
    {
        value: 2,
        label: '验收中'
    },
    {
        value: 3,
        label: '验收通过'
    },
    {
        value: 4,
        label: '验收不通过'
    }
]

// 搜索条件
const searchOption = [
    {
        name: '预警级别',
        value: 'warnLevel',
        type: 'select',
        data: warningArr
    },
    {
        name: '检查时间',
        value: 'startEndDate',
        type: 'dateRangeFormat',
        attr: {
            rangeFormat: ['fillStartTime', 'fillEndTime']
        }
    },
    {
        name: '拟采取措施状态',
        value: 'proposedMeasuresStatus',
        type: 'select',
        data: proposedMeasures
    },
    {
        name: '验收记录状态',
        value: 'acceptanceRecordStatus',
        type: 'select',
        data: acceptanceRecord.filter(v => v.value !== 0)
    },
]

// 定义表头
const columns = [
    {
        title: '序号',
        width: 65,
        scopedSlots: { customRender: 'serial' },
    },
    {
        title: '分公司',
        width: 90,
        dataIndex: 'branchName',
    },
    {
        title: '项目名称',
        width: 100,
        dataIndex: 'projectName',
    },
    {
        title: '预警级别',
        width: 100,
        dataIndex: 'warnLevel',
        scopedSlots: { customRender: 'warningLevel' },
    },
    {
        title: '检查人',
        width: 100,
        dataIndex: 'creatorName',
    },
    {
        title: '检查时间',
        width: 120,
        dataIndex: 'createTime',
    },
    {
        title: '拟采取措施',
        width: 140,
        dataIndex: 'measureStatus',
        scopedSlots: { customRender: 'realGrossOutput' },
    },
    {
        title: '验收记录',
        width: 100,
        dataIndex: 'checkStatus',
        scopedSlots: { customRender: 'realPerCapita' },
    },
    {
        title: '操作',
        dataIndex: 'action',
        width: 200,
        scopedSlots: { customRender: 'action' },
    },
]

// 模拟数据
const mockdata = [
    {
        id: 1,
        branchCompanyName: '四川分公司',
        projectName: '独角兽岛园区二批次项目',
        warningLevel: 0,
        checkUser: '张三',
        checkTime: '2021.09.12',
        realGrossOutput: 0,
        realPerCapita: -1
    },
    {
        id: 2,
        branchCompanyName: '四川分公司',
        projectName: '独角兽岛园区二批次项目',
        warningLevel: 0,
        checkUser: '张三',
        checkTime: '2021.09.12',
        realGrossOutput: 1,
        realPerCapita: -1
    },
    {
        id: 3,
        branchCompanyName: '四川分公司',
        projectName: '独角兽岛园区二批次项目',
        warningLevel: 0,
        checkUser: '张三',
        checkTime: '2021.09.12',
        realGrossOutput: 2,
        realPerCapita: -1
    },
    {
        id: 4,
        branchCompanyName: '四川分公司',
        projectName: '独角兽岛园区二批次项目',
        warningLevel: 0,
        checkUser: '张三',
        checkTime: '2021.09.12',
        realGrossOutput: 3,
        realPerCapita: 1
    },
    {
        id: 5,
        branchCompanyName: '四川分公司',
        projectName: '独角兽岛园区二批次项目',
        warningLevel: 0,
        checkUser: '张三',
        checkTime: '2021.09.12',
        realGrossOutput: 3,
        realPerCapita: 2
    },
    {
        id: 6,
        branchCompanyName: '四川分公司',
        projectName: '独角兽岛园区二批次项目',
        warningLevel: 0,
        checkUser: '张三',
        checkTime: '2021.09.12',
        realGrossOutput: 3,
        realPerCapita: 3
    },
    {
        id: 7,
        branchCompanyName: '四川分公司',
        projectName: '独角兽岛园区二批次项目',
        warningLevel: 0,
        checkUser: '张三',
        checkTime: '2021.09.12',
        realGrossOutput: 3,
        realPerCapita: 4
    },
]


export {
    searchOption,
    columns,
    mockdata,
    warningArr,
    proposedMeasures,
    acceptanceRecord
}